/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class ListAuthData {
	private static final int ROW_COUNT = 100;
	
public void listTestData() throws PersistentException {
		auth.DAOFactory lDAOFactory = auth.DAOFactory.getDAOFactory();
		System.out.println("Listing Usuario...");
		auth.Usuario[] authUsuarios = lDAOFactory.getUsuarioDAO().listUsuarioByQuery(null, null);
		int length = Math.min(authUsuarios.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(authUsuarios[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
	}
	
	public static void main(String[] args) {
		try {
			ListAuthData listAuthData = new ListAuthData();
			try {
				listAuthData.listTestData();
			}
			finally {
				auth.AuthPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
